home *** CD-ROM | disk | FTP | other *** search
- /*
- File: Exceptions.h
-
- Copyright: © 1984-1994 by Apple Computer, Inc., all rights reserved.
-
- WARNING
- This file was auto generated by the interfacer tool. Modifications
- must be made to the master file.
-
- */
-
- #ifndef __EXCEPTIONS__
- #define __EXCEPTIONS__
-
- #ifndef __TYPES__
- #include <Types.h>
- /* #include <ConditionalMacros.h> */
- /* #include <MixedMode.h> */
- /* #include <Traps.h> */
- #endif
-
- #define DEBUGOFF 0
-
- #define DEBUGWARN 1
-
- #define DEBUGON 2
-
- #define DEBUGFULL 3
-
- #ifndef DEBUGLEVEL
- #define DEBUGLEVEL DEBUGOFF
-
- #endif
-
- extern void PlaceHolder(void);
- #define resumeLabelsOn(exception) resume_##exception:
-
- #define resumeLabelsOff(exception)
-
- #define resumeLabel(exception)
-
- #define SetExceptionOption(option)
-
- #define trace "\p;dprintf;doTrace"
-
- #define notrace "\p;dprintf;mnop"
-
- #define traceon ((DEBUGLEVEL > DEBUGWARN) && defined(TRACEON))
-
- #define debugon (DEBUGLEVEL > DEBUGWARN)
-
- extern void dprintf(StringPtr traceOption, char theFormat[], ...)
- TWOWORDINLINE(0xABFF, 0x594F);
- extern void *check_dprintf(void *assertion, StringPtr traceOption, char theFormat[], ...)
- SIXWORDINLINE(0x201F, 0x6606, 0xABFF, 0x594F, 0x4240, 0x594F);
- extern void *checkpos_dprintf(void *assertion, StringPtr traceOption, char theFormat[], ...)
- SIXWORDINLINE(0x201F, 0x6C06, 0xABFF, 0x594F, 0x4240, 0x594F);
- #if DEBUGLEVEL==DEBUGON
- #define check(assertion) \
- if (true) { \
- if (assertion) ; \
- else { \
- dprintf(notrace, "Assertion \"%s\" Failed", "assertion"); \
- } \
- } else PlaceHolder()
-
- #elif DEBUGLEVEL==DEBUGFULL
- #define check(assertion) \
- if (true) { \
- if (assertion) ; \
- else { \
- dprintf(notrace, "Assertion \"%s\" Failed\n" \
- "File: %s\n" \
- "Line: %d", \
- "assertion", __FILE__, __LINE__); \
- } \
- } else PlaceHolder()
-
- #else
- #define check(assertion)
-
- #endif
-
- #if DEBUGLEVEL==DEBUGON
- #define ncheck(assertion) \
- if (true) { \
- void* __privateAssertion = (void*)(assertion); \
- \
- if (__privateAssertion) { \
- dprintf(notrace, "Assertion \"!(%s [= 0x%08X])\" Failed", \
- "assertion", __privateAssertion); \
- } \
- } else PlaceHolder()
-
- #elif DEBUGLEVEL==DEBUGFULL
- #define ncheck(assertion) \
- if (true) { \
- void* __privateAssertion = (void*)(assertion); \
- \
- if (__privateAssertion) { \
- dprintf(notrace, "Assertion \"!(%s [= 0x%08X])\" Failed\n" \
- "File: %s\n" \
- "Line: %d", \
- "assertion", __privateAssertion, __FILE__, __LINE__); \
- } \
- } else PlaceHolder()
-
- #else
- #define ncheck(assertion)
-
- #endif
-
- #if DEBUGLEVEL==DEBUGON
- #define check_action(assertion, action) \
- if (true) { \
- if (assertion) ; \
- else { \
- dprintf(notrace, "Assertion \"%s\" Failed", "assertion"); \
- { action } \
- } \
- } else PlaceHolder()
-
- #elif DEBUGLEVEL==DEBUGFULL
- #define check_action(assertion, action) \
- if (true) { \
- if (assertion) ; \
- else { \
- dprintf(notrace, "Assertion \"%s\" Failed\n" \
- "File: %s\n" \
- "Line: %d", \
- "assertion", __FILE__, __LINE__); \
- { action } \
- } \
- } else PlaceHolder()
-
- #else
- #define check_action(assertion, action)
-
- #endif
-
- #if DEBUGLEVEL==DEBUGON
- #define ncheck_action(assertion, action) \
- if (true) { \
- void* __privateAssertion = (void*)(assertion); \
- \
- if (__privateAssertion) { \
- dprintf(notrace, "Assertion \"!(%s [= 0x%08X])\" Failed", \
- "assertion", __privateAssertion); \
- { action } \
- } \
- } else PlaceHolder()
-
- #elif DEBUGLEVEL==DEBUGFULL
- #define ncheck_action(assertion, action) \
- if (true) { \
- void* __privateAssertion = (void*)(assertion); \
- \
- if (__privateAssertion) { \
- dprintf(notrace, "Assertion \"!(%s [= 0x%08X])\" Failed\n" \
- "File: %s\n" \
- "Line: %d", \
- "assertion", __privateAssertion, __FILE__, __LINE__); \
- { action } \
- } \
- } else PlaceHolder()
-
- #else
- #define ncheck_action(assertion, action)
-
- #endif
-
- #if DEBUGLEVEL==DEBUGON
- #define require(assertion, exception) \
- if (true) { \
- if (assertion) ; \
- else { \
- dprintf(notrace, "Assertion \"%s\" Failed\n" \
- "Exception \"%s\" Raised", \
- "assertion", "exception"); \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #elif DEBUGLEVEL==DEBUGFULL
- #define require(assertion, exception) \
- if (true) { \
- if (assertion) ; \
- else { \
- dprintf(notrace, "Assertion \"%s\" Failed\n" \
- "Exception \"%s\" Raised\n" \
- "File: %s\n" \
- "Line: %d", \
- "assertion", "exception", __FILE__, __LINE__); \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #else
- #define require(assertion, exception) \
- if (true) { \
- if (assertion) ; \
- else { \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #endif
-
- #if DEBUGLEVEL==DEBUGON
- #define nrequire(assertion, exception) \
- if (true) { \
- void* __privateAssertion = (void*)(assertion); \
- \
- if (__privateAssertion) { \
- dprintf(notrace, "Assertion \"!(%s [= 0x%08X])\" Failed\n" \
- "Exception \"%s\" Raised", \
- "assertion", __privateAssertion, "exception"); \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #elif DEBUGLEVEL==DEBUGFULL
- #define nrequire(assertion, exception) \
- if (true) { \
- void* __privateAssertion = (void*)(assertion); \
- \
- if (__privateAssertion) { \
- dprintf(notrace, "Assertion \"!(%s [= 0x%08X])\" Failed\n" \
- "Exception \"%s\" Raised\n" \
- "File: %s\n" \
- "Line: %d", \
- "assertion", __privateAssertion, "exception", __FILE__, \
- __LINE__); \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #else
- #define nrequire(assertion, exception) \
- if (true) { \
- if (assertion) { \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #endif
-
- #if DEBUGLEVEL==DEBUGON
- #define require_action(assertion, exception, action) \
- if (true) { \
- if (assertion) ; \
- else { \
- dprintf(notrace, "Assertion \"%s\" Failed\n" \
- "Exception \"%s\" Raised", \
- "assertion", "exception"); \
- { action } \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #elif DEBUGLEVEL==DEBUGFULL
- #define require_action(assertion, exception, action) \
- if (true) { \
- if (assertion) ; \
- else { \
- dprintf(notrace, "Assertion \"%s\" Failed\n" \
- "Exception \"%s\" Raised\n" \
- "File: %s\n" \
- "Line: %d", \
- "assertion", "exception", __FILE__, __LINE__); \
- { action } \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #else
- #define require_action(assertion, exception, action) \
- if (true) { \
- if (assertion) ; \
- else { \
- { action } \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #endif
-
- #if DEBUGLEVEL==DEBUGON
- #define nrequire_action(assertion, exception, action) \
- if (true) { \
- void* __privateAssertion = (void*)(assertion); \
- \
- if (__privateAssertion) { \
- dprintf(notrace, "Assertion \"!(%s [= 0x%08X])\" Failed\n" \
- "Exception \"%s\" Raised", \
- "assertion", __privateAssertion, "exception"); \
- { action } \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #elif DEBUGLEVEL==DEBUGFULL
- #define nrequire_action(assertion, exception, action) \
- if (true) { \
- void* __privateAssertion = (void*)(assertion); \
- \
- if (__privateAssertion) { \
- dprintf(notrace, "Assertion \"!(%s [= 0x%08X])\" Failed\n" \
- "Exception \"%s\" Raised\n" \
- "File: %s\n" \
- "Line: %d", \
- "assertion", __privateAssertion, "exception", __FILE__, \
- __LINE__); \
- { action } \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #else
- #define nrequire_action(assertion, exception, action) \
- if (true) { \
- if (assertion) { \
- { action } \
- goto exception; \
- resumeLabel(exception); \
- } \
- } else PlaceHolder()
-
- #endif
-
- #define retry \
- if (true) { \
- goto start; \
- } else PlaceHolder()
-
- #define resume(exception) \
- if (true) { \
- goto resume_##exception; \
- } else PlaceHolder()
-
- #endif
-
-